﻿using System.Collections.Generic;
using System.Data;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Client.Logic.Distribution
{
    public class LLength
    {
        public static List<EXMissionStructures_PoleLength> SelectAllIdName()
        {
            DataTable dt = WebConsumer.Distribution.WDistributionLength.SelectAllIdName().Tables[0];
            List<EXMissionStructures_PoleLength> lstLengths = new List<EXMissionStructures_PoleLength>();

            foreach (DataRow drTreatment in dt.Rows)
            {
                EXMissionStructures_PoleLength length = new EXMissionStructures_PoleLength();

                length.Id = ConvertHelper.ToInt32(drTreatment["LengthId"]);
                length.Name = drTreatment["Name"].ToString();

                lstLengths.Add(length);
            }

            return lstLengths;
        }
    }
}
